var React =  require('react')
const ListItem = require('./listItem')
const TypeNew = require('./typeNew')
const imgUrl = require('../../../static/images/p1.png')
var TodoList = React.createClass({
    getInitialState: function () {
           return {
               todoList: []
           }
    },
    changeList (arry) {
        this.setState({
            todoList: arry
        })
    },
    render: function () {
        return (
            <div className="productBox">
                <TypeNew addItem={this.changeList} todoList={this.state.todoList}/>
                <ListItem todoList={this.state.todoList} delItem={this.changeList} chooseAll={this.changeList} chooseItem={this.changeList}></ListItem>
                <img src={imgUrl} />
            </div>
        );
    }

})
module.exports = TodoList